package com.cqw.commontest.designmode.strategy;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-09-24 10:54
 * @Description:
 */
public class CatWeightComparator implements Comparator<Cat> {
    @Override
    public int compare(Cat o1, Cat o2) {
        if (o1.getWeight() < o2.getWeight()) return -1;
        else if (o1.getWeight() > o2.getWeight()) return 1;
        return 0;
    }
}
